package com.cn.star.java8;
/**
 * 冒泡排序
 * @author star
 *
 */
public class T {

	public static void main(String[] args) {
		
		int[] array = {4,3,2,1,6};
		for(int i=0;i<array.length;i++) {
			for(int j=0;j<array.length-i-1;j++) {
				if(array[j]>array[j+1]) {
					int temp = array[j];
					array[j] = array[j+1];
					array[j+1] = temp;
				}
			}
		}
		for(int x :array) {
			System.out.print(x);

		}
	}

}
